<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateYCategorysTypesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if(!Schema::hasTable('y_categorys_types')) {
            Schema::create('y_categorys_types', function (Blueprint $table) {
                $table->engine = 'MyISAM';
                $table->increments('categorys_type_id');
                $table->string('categorys_type_name',50)->default(0)->comment('图片类型名称');
                $table->tinyInteger('categorys_type_status')->default(1)->comment('0已删除，1正常,2停用');
                $table->timestamps();

                //索引
                $table->index('groups_type_name');
            });
        };
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('y_categorys_types');
    }
}
